<?php
/**
 * @author qingyu8@staff.weibo.com
 * @date 2018/02/01
 */
namespace api\modules\v1\controllers;

use yii\rest\ActiveController;
use yii\web\Response;
use Yii;

class SiteController extends ActiveController {
    public $modelClass = 'api\models\User';

    public function actions() {
        return array_merge(parent::actions(), [
            'error' => ['class' => 'yii\web\ErrorAction',],
        ]);
    }

    public function actionTest() {
        Yii::$app->response->format = Response::FORMAT_JSON;
        return [
            'message' => 'API test Ok!',
            'code' => 100,
        ];
    }
}
